home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / embedcomponents / nsIAppStartupNotifier.h
C/C++ Source or Header  |  2006-05-08  |  4KB  |  93 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #ifndef nsIAppStartupNotifier_h___
  39. #define nsIAppStartupNotifier_h___
  40.  
  41. #include "nsIObserver.h"
  42.  
  43. /*
  44.  Some components need to be run at the startup of mozilla or embedding - to 
  45.  start new services etc.
  46.  
  47.  This interface provides a generic way to start up arbitrary components 
  48.  without requiring them to hack into main1() (or into NS_InitEmbedding) as 
  49.  it's currently being done for services such as wallet, command line handlers 
  50.  etc.
  51.  
  52.  We will have a category called "app-startup" which components register 
  53.  themselves in using the CategoryManager.
  54.  
  55.  Components can also (optionally) add the word "service," as a prefix 
  56.  to the "value" they pass in during a call to AddCategoryEntry() as
  57.  shown below:
  58.  
  59.     categoryManager->AddCategoryEntry(APPSTARTUP_CATEGORY, "testcomp",
  60.                         "service," NS_WALLETSERVICE_CONTRACTID
  61.                         PR_TRUE, PR_TRUE,
  62.                         getter_Copies(previous));
  63.  
  64.  Presence of the "service" keyword indicates the components desire to 
  65.  be started as a service. When the "service" keyword is not present
  66.  we just do a do_CreateInstance.
  67.  
  68.  When mozilla starts (and when NS_InitEmbedding()) is invoked
  69.  we create an instance of the AppStartupNotifier component (which 
  70.  implements nsIObserver) and invoke it's Observe() method. 
  71.  
  72.  Observe()  will enumerate the components registered into the
  73.  APPSTARTUP_CATEGORY and notify them that startup has begun
  74.  and release them.
  75. */
  76.  
  77. #define NS_APPSTARTUPNOTIFIER_CONTRACTID "@mozilla.org/embedcomp/appstartup-notifier;1"
  78. #define NS_APPSTARTUPNOTIFIER_CLASSNAME  "AppStartup Notifier"
  79.  
  80. #define APPSTARTUP_CATEGORY "app-startup"
  81. #define APPSTARTUP_TOPIC    "app-startup"
  82.  
  83.  
  84. /*
  85.  Please note that there's not a new interface in this file.
  86.  We're just leveraging nsIObserver instead of creating a
  87.  new one
  88.  
  89.  This file exists solely to provide the defines above
  90. */
  91.  
  92. #endif /* nsIAppStartupNotifier_h___ */
  93.